//修改人员
var homeUserInfo = new Vue({
    el: "#homeUserInfo",
    data: function () {
        return {
            userInfo: {
                userCode: "",
                userName: "",
                // 用于上传图片
                photo: "",
                gender: "",
                tel: "",
                mobile: "",
                wechat: "",
                identificationTypeCode: "01",
                identificationNo: "",
                email: "",
                orgInfo: "",
                photoUrl: ""
            }
        }
    },
    methods: {
        getData: function () {
            VanyAjax("/index/queryUserInfo", {}, "GET").done(function (data) {
                this.userInfo = data.userInfo;
            }, false, this);
        }
    }
});

homeUserInfo.getData();
var myFavorite = new Vue({
    el: "#myFavorite",
    data: function () {
        return {
            menuList: [],
            isOpen: false
        }
    },
    computed: {
        menus: function () {
            return this.isOpen ? this.menuList : this.menuList.slice(0, 5);
        }
    },
    methods: {
        getData: function () {
            VanyAjax("/index/favorites", {}, "GET").done(function (data) {
                this.menuList = data;
            }, false, this);
        },
        toPage: function (menu) {
            location.href = "/index#" + menu.uri;
        },
        open: function () {
            this.isOpen = !this.isOpen;
        }
    }
});

myFavorite.getData();

var link = new Vue({
    el: "#link",
    data: function () {
        return {
            links: []
        }
    },
    methods: {
        getData: function () {
            VanyAjax("/index/links", {}, "GET").done(function (data) {
                this.links = data;
            }, false, this);
        }
    }
});

link.getData();

var notification = new Vue({
    el: "#notification",
    data: function () {
        return {
            notifies: []
        }
    },
    methods: {
        getData: function () {
            VanyAjax("/index/notifies", {}, "GET").done(function (data) {
                this.notifies = data;
            }, false, this);
        }
    }
});

notification.getData();